import type { RouteRecordRaw } from 'vue-router'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('@/components/layout/MainLayout.vue'),
    redirect: '/chat',
    children: [
      {
        path: '/chat',
        name: 'Chat',
        component: () => import('@/views/ChatPage.vue'),
        meta: {
          title: '智能问答',
          keepAlive: true
        }
      },
      {
        path: '/session/:sessionId',
        name: 'SessionChat',
        component: () => import('@/views/ChatPage.vue'),
        meta: {
          title: '会话聊天',
          keepAlive: true
        }
      },
      {
        path: '/mcp-services',
        name: 'MCPServices',
        component: () => import('@/views/MCPServicesPage.vue'),
        meta: {
          title: 'MCP服务管理'
        }
      },
      {
        path: '/settings',
        name: 'Settings',
        component: () => import('@/views/SettingsPage.vue'),
        meta: {
          title: '系统设置'
        }
      },
      {
        path: '/integration-test',
        name: 'IntegrationTest',
        component: () => import('@/views/IntegrationTest.vue'),
        meta: {
          title: '集成测试'
        }
      }
    ]
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/NotFoundPage.vue'),
    meta: {
      title: '页面未找到'
    }
  }
]

export default routes